package com.tanhua.server.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.tanhua.common.mapper.UserInfoMapper;
import com.tanhua.common.pojo.UserInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.management.Query;

@Service
@Slf4j
public class UserInfoService {
    @Autowired
    private UserInfoMapper userInfoMapper;
    /**
     * 查询用户信息
     * @param userId
     * @return
     */
    public UserInfo queryUserInfoByUserId(Long userId) {
        QueryWrapper<UserInfo> query = new QueryWrapper<>();
        query.eq("user_id",userId);
        UserInfo userInfo = userInfoMapper.selectOne(query);
        return userInfo;
    }
}
